//
//  UIImage+Color.m
//  YJJ0
//
//  Created by dadaxueche on 16/7/12.
//  Copyright © 2016年 王—wagn. All rights reserved.
//

#import "UIImage+Color.h"

@implementation UIImage (Color)

+ (UIImage *)imageWithColor:(UIColor *)color
{
    CGRect frame = CGRectMake(0.f, 0.f, 1.f, 1.f);
    UIGraphicsBeginImageContext(frame.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    
    CGContextSetFillColorWithColor(context, [color CGColor]);
    CGContextFillRect(context, frame);
    
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    return image;
    
  
    
}

@end
